import request from './request'

// 获取裁判员列表
export const getJudgeList = (params) => {
  return request.get('/judge/list', { params })
}

// 获取裁判员详情
export const getJudgeDetail = (id) => {
  return request.get(`/judge/${id}`)
}

// 创建裁判员
export const createJudge = (data) => {
  return request.post('/judge', data)
}

// 更新裁判员信息
export const updateJudge = (id, data) => {
  return request.put(`/judge/${id}`, data)
}

// 删除裁判员
export const deleteJudge = (id) => {
  return request.delete(`/judge/${id}`)
}

// 批量删除裁判员
export const batchDeleteJudges = (ids) => {
  return request.delete('/judge/batch', { data: { ids } })
}

// 启用/禁用裁判员
export const toggleJudgeStatus = (id, status) => {
  return request.put(`/judge/${id}/status`, { status })
}

// 导入裁判员
export const importJudges = (data) => {
  return request.post('/judge/import', data)
}

// 导出裁判员
export const exportJudges = (params) => {
  return request.get('/judge/export', { params, responseType: 'blob' })
}
